namespace CodeConsult.Nordic.nRF8001.ApplicationControlInterface.Events.SystemEvents
{
    public class HardwareErrorEvent : AciEventBase
    {
        public const byte OpCode = 0x83;
 
        public ushort LineNumber { get; set; }
        public string FileName { get; set; }

        protected override void DecodeFromBuffer()
        {
            var fileNameLen = DecodeHelper.BufferLength - 3;
            LineNumber = DecodeHelper.GetUnsignedShort(DecodeHelper.ByteOrder.LsbMsb);
            FileName = DecodeHelper.GetString(fileNameLen);
        }
    }
}
